<html>
  <head>
    <script type="text/javascript" src="jquery-1.5.2.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
           $("#container").click(function (e) {
                alert("a");
              var $ch = $(e.target).children();
              
              $("#results span:first").text($ch.length);
              
              e.preventDefault();
              return false;
            });

        });
    </script>
  </head>
  <body>
    <div id="container">
        <div>
          <p>This <span>is the <em>way</em> we</span> 
          write <em>the</em> demo,</p>
        </div>
        
    </div>
    <span id="results">Found <span>0</span> children in <span>TAG</span>.</span>
  </body>
</html>